<?php
/**
 * 数据库相关配置文件
 * @author zhangzhan@snda.com
 */
$db_cache_config_arr = array(
    'db_physical' => array(  //physical master-slave shard configuration
        0 => array(
            'write' => array(
                'host' => '127.0.0.1',
                'port' => 3306,
            ),
            'read' => array(
                'host' => '127.0.0.1',
                'port' => 3306,
            ),
        ),
        // open
        1 => array(
            'write' => array(
                'host' => '127.0.0.1',
                'port' => 3306,
            ),
            'read' => array(
                'host' => '127.0.0.1',
                'port' => 3306,
            ),
            'db_user' => 'root',
            'db_pwd'  => '123456',
        ),
         // open备用数据库服务器
        2 => array(
            'write' => array(
                'host' => '127.0.0.1',
                'port' => 3306,
            ),
            'read' => array(
                'host' => '127.0.0.1',
                'port' => 3306,
            ),
            'db_user' => 'root',
            'db_pwd'  => '123456',
        ),
    ),

    'db_cluster' => array(
    ),

    'db_singles' => array(
        1 => array(
            'map' => 0,
            'db_name' => 'op_stat',
        ),
        2 => array(
            'map' => 1,
            'db_name' => 'platform',
        ),
        3 => array(
            'map' => 1,
            'db_name' => 'platform'
        ),
        //备用数据库服务器
        4 => array(
       		'map' => 2,
            'db_name' => 'platform_b'
        ),
    ),
    
    //cache 相关配置
    'cache_physical' => array(
        0 => array('host' => '127.0.0.1', 'port' => 11211),
    ),

    'cache_cluster' => array(
        //App Store
        0  => array(0),
        
        //App Store 及 其给它项目组接口的公用缓存
        1  => array(0),

		//用于应用相关统计
        2  => array(0),
    )
);

//将配置合并的主配置文件
$GLOBALS['gConfig'] = array_merge($GLOBALS['gConfig'], $db_cache_config_arr);

?>